package com.xyz.rok.tools.model.response;

import lombok.Data;

import java.math.BigDecimal;

/**
 * @author ZhangYiXin
 * @version 1.0
 * @date 2021/6/2 16:01
 **/
@Data
public class MemberStatResponse {

    private Long gameId;
    private String nickName;
    private BigDecimal growthRate;
    private BigDecimal min = BigDecimal.ZERO;
    private BigDecimal max = BigDecimal.ZERO;

    public BigDecimal getGrowthRate() {
        this.growthRate = max.subtract(min).divide(min, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
        return growthRate;
    }

    public void setGrowthRate(BigDecimal growthRate) {
        this.growthRate = growthRate;
    }
}
